package com.entity;

import com.alibaba.fastjson.annotation.JSONField;
import com.fasterxml.jackson.annotation.JsonInclude;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;

import javax.persistence.*;
import java.io.Serializable;
import java.util.Date;
import java.util.List;

/**
 * @author Yadasu
 * @date 2020/12/18 14:02
 */

@Data
@Entity
@Table(name = "sys_role")
@JsonInclude(JsonInclude.Include.NON_NULL)
public class Role  implements Serializable {
    private static final long serialVersionUID = 1589747195238944256L;
    @Id
    @GeneratedValue(strategy = GenerationType.IDENTITY)
    @Column(name = "id")
    @ApiModelProperty(value = "角色表id")
    private Integer id;

    @Column(name = "name")
    @ApiModelProperty(value = "角色表权限名")
    private String name;

    @Column(name = "description")
    @ApiModelProperty(value = "角色表权限描述")
    private String description;

    @Column(name = "create_by")
    @ApiModelProperty(value = "角色表相关权限创建人")
    private String createdBy;

    @Column(name = "update_by")
    @ApiModelProperty(value = "角色表相关权限更新人")
    private String updatedBy;

    @Column(name = "create_time")
    @JSONField(format="yyyy-MM-dd HH:mm:ss")
    @ApiModelProperty(value = "角色表相关权限创建时间")
    private Date createdTime;

    @Column(name = "update_time")
    @JSONField(format="yyyy-MM-dd HH:mm:ss")
    @ApiModelProperty(value = "角色表相关权限更新时间")
    private Date updatedTime;

    @Column(name = "name_zh")
    @ApiModelProperty(value = "角色表权限具体表述名")
    private String nameZh;

    @Column(name = "is_enable")
    @ApiModelProperty(value = "角色表权限是否开启")
    private boolean enabled;

    @Transient
    private List<Menu> menu;
}
